/*
 * This is Text to speech adapter class.It Takes the input text as Input and plays the audio file.
 */

package com.oops.appquery;
import java.io.InputStream;
import javazoom.jl.decoder.JavaLayerException;
import javazoom.jl.player.Player;

public class TextToSpeech {
    
    public TextToSpeech(String text)throws Exception
    {
    	framework obj=new framework();
		InputStream line= obj.gsearch("http://translate.google.com/translate_tts?" + "q="
                + text.replace(" ", "%20") + "&tl=en");
		play(line);
		
    }
    
     public void play(InputStream sound) throws JavaLayerException {
            new Player(sound).play();
    }

}

